<script setup>
const props = defineProps({
  back: {
    type: Boolean,
    default: false
  },
  add: {
    type: Boolean,
    default: false
  }
})
const emit = defineEmits(['add'])
const handleBack = () => {
  uni.navigateBack()
}
const handleAdd = () => {
  emit('add')
}
</script>

<template>
  <nut-navbar v-bind="{
    ...props,
    ...$attrs
  }">
    <template v-if="back" #left>
      <nut-icon name="left" @click="handleBack" />
    </template>
    <template #right>
      <nut-icon v-if="add" name="uploader" custom-color="#64b578" @click="handleAdd" />
    </template>
  </nut-navbar>
</template>

<style scoped lang="scss">

</style>
